
package com.lzh.seatrend.elasticsearch.service;

import com.lzh.seatrend.elasticsearch.entity.User;
import org.elasticsearch.index.query.QueryStringQueryBuilder;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


/**
 * @Classname UserServiceImpl
 * @Description TODO
 * @Date 2021/11/8 15:33
 * @Created by liuzihao
 */

public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;


    @Override
    public Boolean insert(User user) {
        boolean flag = false;
        try {
//            userDao.save(user);
            flag = true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return flag;
    }

    @Override
    public List<User> search(String searchContent) {
        QueryStringQueryBuilder builder = new QueryStringQueryBuilder(searchContent);
        System.out.println("查询的语句" + builder);
//        User user = new User();
//        userDao.searchSimilar(user,searchContent,null);
        return null;
    }

    @Override
    public List<User> searchUserByWeight(String searchContent) {
        return null;
    }
}
